<table class="cards table">
    <caption>Cards for {{cards_caption|default:'all accounts'}}</caption>
    <thead>
        <tr>
            <th>Card name</th>
            <th>Credit card</th>
            <th>Net payment enabled</th>
            {% if not account %}
            <th>Account</th>
            {% endif %}
        </tr>
    </thead>
    <tbody>
        {% for card in cards %}
        <tr class="{% cycle odd even %}">
            <td>
                {% if account %}
                <a href="{% url account_card_details card_id=card.id account_id=account.id%}">{{card.name}}</a>
                {% else %}
                <a href="{% url card_details card_id=card.id %}">{{card.name}}</a>
                {% endif %}
            </td>
            <td>
                {% if card.credit_card %}
                    yes
                {% else %}
                    no
                {% endif %}
            </td>
            <td>
                {% if card.net_payment %}
                    yes
                {% else %}
                    no
                {% endif %}
            </td>
            {% if not account %}
            <td>
                {{card.account.number}}
            </td>
            {% endif %}
        </tr>
        {% endfor %}
    </tbody>
</table>
